/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import model.backstage.Data;

/**
 *
 * @author Guilherme
 */
public class Emprestimo
{
    private String itemID;
    private String usuarioID;
    private Data dataEmprestimo;
    private Data dataDevolucao;
    private Integer nroRenovacoes;
    
    /**
     * 
     * @param r itemID
     * @param s usuarioID
     * @param d dataEmprestimo
     * @param e dataDevolucao
     */
    public Emprestimo (String r, String s, Data d, Data e)
    {
        this.setItemID(r);
        this.setUsuarioID(s);
        this.setDataEmprestimo(d);
        this.setDataDevolucao(e);
        this.setNroRenovacoes(0);
    }

    public Data getDataEmprestimo()
    {
        return dataEmprestimo;
    }

    public boolean setDataEmprestimo(Data d)
    {
        if (d != null)
        {
            this.dataEmprestimo = d;
            return true;
        } else
        {
            return false;
        }
    }

    public Data getDataDevolucao()
    {
        return dataDevolucao;
    }

    public boolean setDataDevolucao(Data d)
    {
        if (d != null)
        {
            this.dataDevolucao = d;
            return true;
        } else
        {
            return false;
        }
    }

    public int getNroRenovacoes()
    {
        return nroRenovacoes;
    }

    public boolean setNroRenovacoes(int i)
    {
        if (i >= 0)
        {
            this.nroRenovacoes = i;
            return true;
        } else
        {
            return false;
        }
    }

    public String getItemID()
    {
        return itemID;
    }

    public void setItemID(String itemID)
    {
        this.itemID = itemID;
    }

    public String getUsuarioID()
    {
        return usuarioID;
    }

    public void setUsuarioID(String usuarioID)
    {
        this.usuarioID = usuarioID;
    }
    
}
